Skip to content

qa-tests: use a specific version of the prebuilt db in RPC and Tip-Tracking tests#19565

Merged
Giulio2002 merged 9 commits intomainfrom
qa-tests/rpc_test_use_specific_version
Mar 3, 2026
Merged

qa-tests: use a specific version of the prebuilt db in RPC and Tip-Tracking tests#19565
Giulio2002 merged 9 commits intomainfrom
qa-tests/rpc_test_use_specific_version

Conversation

@mriccobene
Copy link
Member

This PR allows us to use different DB versions between main branch and release branch to avoid any incompatibility problems between databases

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates QA RPC-related GitHub Actions workflows to use a version-pinned prebuilt DB path, intended to let release branches run against a DB compatible with that release.

Changes:

  • Pin ERIGON_REFERENCE_DATA_DIR to /opt/erigon-versions/*reference-version-3.4*/datadir in multiple RPC performance and integration workflows.
  • Apply the same pinning for the Gnosis RPC integration workflow.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/qa-rpc-performance-tests.yml Pins the reference datadir used by the historic RPC performance workflow.
.github/workflows/qa-rpc-performance-comparison-tests.yml Pins the reference datadir used by the “latest” RPC performance comparison workflow.
.github/workflows/qa-rpc-integration-tests.yml Pins the reference datadir used by mainnet RPC integration tests.
.github/workflows/qa-rpc-integration-tests-remote.yml Pins the reference datadir used by mainnet RPC integration tests (remote).
.github/workflows/qa-rpc-integration-tests-latest.yml Pins the reference datadir used by “latest” mainnet RPC integration tests.
.github/workflows/qa-rpc-integration-tests-gnosis.yml Pins the reference datadir used by Gnosis RPC integration tests.
Comments suppressed due to low confidence (4)

.github/workflows/qa-rpc-integration-tests.yml:36

  • This workflow triggers for both main and release/3.* (including PRs), but ERIGON_REFERENCE_DATA_DIR is now hardcoded to a 3.4 datadir. If main is supposed to keep using the main DB while release uses 3.4, make the path conditional on the target branch (use github.base_ref for PRs, github.ref_name for push/workflow_dispatch).
    env:
      ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-3.4/datadir
      ERIGON_TESTBED_AREA: /opt/erigon-testbed
      ERIGON_QA_PATH: /home/qarunner/erigon-qa
      ERIGON_ASSERT: true
      RPC_PAST_TEST_DIR: /opt/rpc-past-tests

.github/workflows/qa-rpc-integration-tests-remote.yml:36

  • This workflow triggers for both main and release/3.* (including PRs), but ERIGON_REFERENCE_DATA_DIR is now hardcoded to a 3.4 datadir. To avoid main picking up the release DB, make the reference datadir branch-dependent (github.base_ref for PRs; github.ref_name for pushes).
    env:
      ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-3.4/datadir
      ERIGON_TESTBED_AREA: /opt/erigon-testbed
      ERIGON_QA_PATH: /home/qarunner/erigon-qa
      ERIGON_ASSERT: true
      RPC_PAST_TEST_DIR: /opt/rpc-past-tests/remote

.github/workflows/qa-rpc-integration-tests-latest.yml:40

  • This workflow only runs on main, but ERIGON_REFERENCE_DATA_DIR is now pinned to reference-version-3.4. If the intent is “main uses main DB, release uses versioned DB”, this pin will prevent main from tracking the main reference DB and can cause unnecessary incompatibilities; consider using the unversioned/main reference path here and pinning only in release workflows (or making it conditional).
    env:
      ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-3.4/datadir
      ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
      ERIGON_QA_PATH: /home/qarunner/erigon-qa
      TOTAL_TIME_SECONDS: 900 # 15 minutes
      REFERENCE_SYSTEM_HOST_ADDRESS: 157.180.55.78:8545

.github/workflows/qa-rpc-integration-tests-gnosis.yml:36

  • This workflow triggers for both main and release/3.* (including PRs), but ERIGON_REFERENCE_DATA_DIR is now hardcoded to the 3.4 gnosis reference datadir. If main should continue using the unversioned gnosis reference DB, make this path conditional based on github.ref/base_ref so main and release can diverge as intended.
    env:
      ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/gnosis-reference-version-3.4/datadir
      ERIGON_TESTBED_AREA: /opt/erigon-testbed
      ERIGON_QA_PATH: /home/qarunner/erigon-qa
      ERIGON_ASSERT: true
      RPC_PAST_TEST_DIR: /opt/rpc-past-tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mriccobene mriccobene changed the title qa-tests: use a specific version of the prebuilt db in RPC tests qa-tests: use a specific version of the prebuilt db in RPC and Tip-Tracking tests Mar 3, 2026
@mriccobene mriccobene requested review from Giulio2002 and Copilot March 3, 2026 11:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +46
- name: Set reference data dir based on branch
run: |
# For pull_request events base_ref is the target branch name; for push/dispatch parse from ref.
BRANCH="${{ github.base_ref }}"
if [ -z "$BRANCH" ]; then
BRANCH="${{ github.ref }}"
BRANCH="${BRANCH#refs/heads/}"
fi
if [[ "$BRANCH" == release/* ]]; then
VERSION="${BRANCH#release/}"
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
PREV_VERSION="${MAJOR}.$((MINOR - 1))"
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV
else
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/reference-version/datadir" >> $GITHUB_ENV
fi
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERIGON_REFERENCE_DATA_DIR is being set via $GITHUB_ENV, but later steps use the expression ${{ env.ERIGON_REFERENCE_DATA_DIR }} (e.g., the pre-sync command builds a path from it). The env expression context won’t reflect values written to $GITHUB_ENV, so this will expand to an empty string at workflow-evaluation time. Use the shell variable $ERIGON_REFERENCE_DATA_DIR in run: blocks, and for places that need expressions (like with.path) expose the computed value as a step output and reference steps.<id>.outputs.<name> (or keep a job-level env: expression instead of $GITHUB_ENV).

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +41
VERSION="${BRANCH#release/}"
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PREV_VERSION calculation can underflow for branches like release/3.0 (producing 3.-1) or break if the release branch format isn’t strictly X.Y. Add validation/guarding (e.g., fail fast with a clear error or handle the 0 case explicitly) before writing the computed path to $GITHUB_ENV.

Suggested change
VERSION="${BRANCH#release/}"
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
VERSION="${BRANCH#release/}"
# Expect VERSION in the form X.Y where X and Y are numeric.
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then
echo "Error: Unsupported release branch format '$BRANCH'. Expected 'release/X.Y'." >&2
exit 1
fi
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
# Prevent underflow for minor version 0 (e.g., 3.0 would produce 3.-1).
if [ "$MINOR" -eq 0 ]; then
echo "Error: Cannot compute previous version for '$BRANCH' because minor version is 0." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +46
- name: Set reference data dir based on branch
run: |
# For pull_request events base_ref is the target branch name; for push/dispatch parse from ref.
BRANCH="${{ github.base_ref }}"
if [ -z "$BRANCH" ]; then
BRANCH="${{ github.ref }}"
BRANCH="${BRANCH#refs/heads/}"
fi
if [[ "$BRANCH" == release/* ]]; then
VERSION="${BRANCH#release/}"
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
PREV_VERSION="${MAJOR}.$((MINOR - 1))"
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV
else
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version/datadir" >> $GITHUB_ENV
fi
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as mainnet: ERIGON_REFERENCE_DATA_DIR is set via $GITHUB_ENV, but ${{ env.ERIGON_REFERENCE_DATA_DIR }} is still used later in the workflow. Since the env expression context won’t include runtime $GITHUB_ENV updates, any ${{ env.* }} use will resolve empty. Prefer $ERIGON_REFERENCE_DATA_DIR in shell commands and/or publish the computed path as a step output for use in expressions.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +43
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
PREV_VERSION="${MAJOR}.$((MINOR - 1))"
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PREV_VERSION computation can produce invalid paths for release/3.0 (or any *.0) and assumes a strict X.Y branch naming. Add a guard/validation (and a clear failure message) so the workflow doesn’t silently point at a non-existent reference DB directory.

Suggested change
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
PREV_VERSION="${MAJOR}.$((MINOR - 1))"
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir" >> $GITHUB_ENV
# Expect VERSION in the form X.Y (e.g. 3.1)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then
echo "Error: unsupported release branch name '$BRANCH'. Expected format 'release/X.Y' (e.g. 'release/3.1')." >&2
exit 1
fi
MAJOR="${VERSION%.*}"
MINOR="${VERSION##*.}"
if [ "$MINOR" -eq 0 ] 2>/dev/null; then
echo "Error: cannot compute previous minor version for branch '$BRANCH' (minor component is 0)." >&2
exit 1
fi
PREV_VERSION="${MAJOR}.$((MINOR - 1))"
REF_DIR="/opt/erigon-versions/gnosis-reference-version-${PREV_VERSION}/datadir"
if [ ! -d "$REF_DIR" ]; then
echo "Error: reference data directory '$REF_DIR' does not exist for release branch '$BRANCH'." >&2
exit 1
fi
echo "ERIGON_REFERENCE_DATA_DIR=$REF_DIR" >> $GITHUB_ENV

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@Giulio2002 Giulio2002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Pippi

@Giulio2002 Giulio2002 merged commit 7d69e62 into main Mar 3, 2026
27 checks passed
@Giulio2002 Giulio2002 deleted the qa-tests/rpc_test_use_specific_version branch March 3, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants